CXX=g++
BIN=main
LIBS=-lgl -lftgl -L/sw/lib -lfreetype -L/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries -L/System/Library/Frameworks/GLUT.framework/Versions/A/Headers/ -L/Library/Frameworks/SDL.framework/SDL -L/Library/Frameworks/SDL_net.framework/SDL_net -L/Library/Frameworks/SDL_image.framework/SDL_image -L/Library/Frameworks/SDL_mixer.framework/SDL_mixer
FRAMEWORKS=-framework Cocoa -framework GLUT -framework OpenGL -framework SDL -framework SDL_net -framework SDL_image -framework SDL_mixer 
INCLUDES=-I/usr/include -I/usr/local/include/freetype2 -I/sw/include -I/sw/include/FTGL -I/sw/lib/
CXXCOMPILE=$(CXX) $(INCLUDES)

ALL_SRCS=$(wildcard *.cpp)
ALL_OBJS=$(patsubst %.cpp,%.o,$(ALL_SRCS))

.PHONY: all clean

all: $(BIN)

# Compilación de las fuentes
%.o: %.cpp
	$(CXXCOMPILE) $< -c -o $@
$(BIN): $(ALL_OBJS)
	$(CXXCOMPILE) SDLmain.m  $^ -o $@ $(LIBS) $(FRAMEWORKS)

clean:
	$(RM) $(ALL_OBJS) $(BIN)
